from pybotx import (
    Bot,
    BubbleMarkup,
    HandlerCollector,
    IncomingMessage,
)

from app.commands.keyboard.keyboard import (
    procurement_subdivision, 
    ptl_subdivision, 
    turbo_subdivision
    )

from enum import Enum, auto
from pathlib import Path
from pybotx_fsm import FSMCollector
from app.middlewares.cancel_creation import cancel_creation_middleware
from app.middlewares.db_sessions import db_session_middleware

from shemas import shemas
from resources import strings

collector = HandlerCollector()

class CreateFidback(Enum):
    WAITING_FIDBACK_SUBDIVISION = auto()
    WAITING_FIDBACK_DIVISION = auto()
    WAITING_FIDBACK_DISCRIPTION = auto()

collector = HandlerCollector()
fsm = FSMCollector(CreateFidback)

@collector.command("/fidback", description="Оставить обратную связь")
async def create_fidback(message: IncomingMessage, bot: Bot) -> None:
    await message.state.fsm.change_state(CreateFidback.WAITING_FIDBACK_SUBDIVISION,
                                         fidback=shemas.FidbackCreate())
    await bot.answer_message(body=strings.INPUT_FIDBACK, keyboard=procurement_subdivision)

@fsm.on(CreateFidback.WAITING_FIDBACK_SUBDIVISION, middlewares=[cancel_creation_middleware])
async def waiting_fidback_subdivision(message: IncomingMessage, bot: Bot) -> None:
    if message.file:
        pass